package com.bolt.admin.module.quartz.entity;

import com.bolt.support.spring.jpa.entity.BaseNativeEntity;
import lombok.AccessLevel;
import lombok.Data;
import lombok.experimental.FieldDefaults;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;
import java.util.Date;

/**
 * Auto Generate Javadoc
 *
 * @author 日期:2020-09-29 11:12:32
 *         定时任务
 **/
@Access(AccessType.FIELD)
@Entity
@Table(name = "sys_quartz_job")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
@Data
@FieldDefaults(level = AccessLevel.PRIVATE)
public class JobEntity extends BaseNativeEntity {

    public static final String JOB_KEY = "JOB_KEY";
    /**
     * Spring Bean名称
     */
    @Column(name = "bean_name", length = 255)
    private String beanName;

    /**
     * cron 表达式
     */
    @Column(name = "cron_expression", length = 255)
    private String cronExpression;

    /**
     * 状态：1暂停、0启用
     */
    @Column(name = "is_pause", length = 1)
    private Boolean isPause;

    /**
     * 任务名称
     */
    @Column(name = "job_name", length = 255)
    private String jobName;

    /**
     * 方法名称
     */
    @Column(name = "method_name", length = 255)
    private String methodName;

    /**
     * 参数
     */
    @Column(name = "params", length = 255)
    private String params;

    /**
     * 备注
     */
    @Column(name = "description", length = 255)
    private String description;

    /**
     * 负责人
     */
    @Column(name = "person_in_charge", length = 100)
    private String personInCharge;

    /**
     * 报警邮箱
     */
    @Column(name = "email", length = 100)
    private String email;

    /**
     * 子任务ID
     */
    @Column(name = "sub_task", length = 100)
    private String subTask;

    /**
     * 任务失败后是否暂停
     */
    @Column(name = "pause_after_failure", length = 1)
    private Boolean pauseAfterFailure;

    /**
     * 创建者
     */
    @Column(name = "create_by", length = 255)
    private String createBy;

    /**
     * 更新者
     */
    @Column(name = "update_by", length = 255)
    private String updateBy;

    /**
     * 创建日期
     */
    @Column(name = "create_time", length = 19)
    private Date createTime;

    /**
     * 更新时间
     */
    @Column(name = "update_time", length = 19)
    private Date updateTime;


}